`timescale 1ns / 1ps 
////////////////////////////////////////////////////////////////////////////////// 
// Company:  
// Engineer:  
//  
// Create Date:    16:39:33 03/27/2014  
// Design Name:  
// Module Name:    position_generation  
// Project Name:  
// Target Devices:  
// Tool versions:  
// Description:  
// 
// Dependencies:  
// 
// Revision:  
// Revision 0.01 - File Created 
// Additional Comments:  
// 
////////////////////////////////////////////////////////////////////////////////// 
module position_generation_rev2(	clk, 
										new_enemy_1,//enemy1 generation signal 
										new_enemy_2,//enemy2 generation signal  
										new_enemy_3,  
										new_enemy_4,  
										new_enemy_5,  
										new_enemy_6,  
										new_bullet_1,
										new_bullet_enemy_1, 
										cha_pos_x,//character position signal 
										cha_pos_y, 
										position_x_1, 
										position_y_1, 
										position_x_2, 
										position_y_2,  
										position_x_3, 
										position_y_3,  
										position_x_4, 
										position_y_4,  
										position_x_5, 
										position_y_5,  
										position_x_6, 
										position_y_6,  
										position_bullet_x, 
										position_bullet_y,
										position_bullet_enemy_1_x, 
										position_bullet_enemy_1_y, 
										position_valid_1, //if enemy is in the right range 
										position_valid_2, //if enemy is in the right range  
										position_valid_3,
										position_valid_enemy_1,  
										position_valid_4,  
										position_valid_5,  
										position_valid_6,  
										position_valid_7,//from here are the newly added bullets 
										 new_bullet_cha_horizontal, 
							//			 new_bullet_cha_horizontal_1, 
							//			 new_bullet_cha_horizontal_2, 
										 new_bullet_cha_vertical, 
									//	 new_bullet_enemy_upright, 
									//	 new_bullet_enemy_upleft, 
										 new_bullet_enemy_vertical, 
										 position_bullet_cha_horizontal_x, 
										 position_bullet_cha_horizontal_y, 
								//		 position_bullet_cha_horizontal_x_1, 
								//		 position_bullet_cha_horizontal_y_2, 
								//		 position_bullet_cha_horizontal_x_1, 
								//		 position_bullet_cha_horizontal_y_2, 
										 position_bullet_cha_vertical_x, 
										 position_bullet_cha_vertical_y, 
									//	 position_bullet_enemy_stationary_upright_x, 
									//	 position_bullet_enemy_stationary_upright_y, 
									//	 position_bullet_enemy_stationary_upleft_x, 
									//	 position_bullet_enemy_stationary_upleft_y, 
										 position_bullet_enemy_stationary_vertical_x, 
										 position_bullet_enemy_stationary_vertical_y, 
										 position_valid_cha_horizontal, 
								//		 position_valid_cha_horizontal_1, 
								//		 position_valid_cha_horizontal_2, 
										 position_valid_cha_vertical, 
								//		 position_valid_bullet_enemy_stationary_upright, 
								//		 position_valid_bullet_enemy_stationary_upleft, 
										 position_valid_bullet_enemy_stationary_vertical
									//	  new_enemy_boss,
									//	  new_bullet_enemy_boss,
									//		position_x_boss,
									//		position_y_boss,
									//		position_valid_boss_bullet,
									//		position_valid_boss,
									//		position_bullet_boss_x,
									//		position_bullet_boss_y		  
										 );//if bullet is in the right range 

input   clk, 
        new_enemy_1, 
        new_enemy_2, 
        new_enemy_3, 
        new_enemy_4,  
		  new_bullet_1,
        new_bullet_enemy_1, 
        new_enemy_5, 
        new_enemy_6, 
        new_bullet_cha_horizontal, 
    //    new_bullet_cha_horizontal_1, 
    //    new_bullet_cha_horizontal_2, 
        new_bullet_cha_vertical, 
       // new_bullet_enemy_upright, 
       // new_bullet_enemy_upleft, 
        new_bullet_enemy_vertical/*,
		  new_enemy_boss,
		  new_bullet_enemy_boss*/; 
 
input [9:0] cha_pos_x,cha_pos_y; 
 
output [9:0]	    position_x_1,//normal  
					position_y_1,  
					position_x_2, //track 
					position_y_2,  
					position_x_3, //ripple 
					position_y_3,  
					position_x_4,//circle  
					position_y_4,  
					position_x_5, //line 
					position_y_5,  
					position_x_6,//stationary  
					position_y_6,  
					position_bullet_enemy_1_x, //bullet_basic 
					position_bullet_enemy_1_y,  
					position_bullet_x, 
					position_bullet_y,
					//position_x_boss,
					//position_y_boss,
					//position_valid_boss_bullet,
					//position_valid_boss,
					//position_bullet_boss_x,
					//position_bullet_boss_y,
                    position_bullet_cha_horizontal_x, 
                    position_bullet_cha_horizontal_y, 
                //    position_bullet_cha_horizontal_x_1, 
                 //   position_bullet_cha_horizontal_y_1, 
               //     position_bullet_cha_horizontal_x_2, 
                //    position_bullet_cha_horizontal_y_2, 
                    position_bullet_cha_vertical_x, 
                    position_bullet_cha_vertical_y, 
           //         position_bullet_enemy_stationary_upright_x, 
           //         position_bullet_enemy_stationary_upright_y, 
           //         position_bullet_enemy_stationary_upleft_x, 
           //         position_bullet_enemy_stationary_upleft_y, 
                    position_bullet_enemy_stationary_vertical_x, 
                    position_bullet_enemy_stationary_vertical_y; 
 
output  position_valid_1,//normal  
        position_valid_2,//track 
        position_valid_enemy_1,//bullet_1  
		  position_valid_3,
        position_valid_4,//ripple 
        position_valid_5,//circle 
        position_valid_6,//line 
        position_valid_7,//stationary 
        position_valid_cha_horizontal, 
  //      position_valid_cha_horizontal_1, 
   //     position_valid_cha_horizontal_2, 
        position_valid_cha_vertical, 
   //     position_valid_bullet_enemy_stationary_upright, 
   //     position_valid_bullet_enemy_stationary_upleft, 
        position_valid_bullet_enemy_stationary_vertical; 
 
wire [15:0] rand; 
 
rand random_generation(			.clk(clk), 
										.rand(rand)); 
 
enemy enemy_1(						.clk(clk), 
										.rand(rand), 
										.new_enemy(new_enemy_1), 
										.position_x(position_x_1), 
										.position_y(position_y_1), 
										.position_valid(position_valid_1));     
	 
enemy_AI_track_cha enemy_2(	.clk(clk), 
										.rand(rand), 
										.new_enemy(new_enemy_2), 
										.cha_pos_x(cha_pos_x), 
										.cha_pos_y(cha_pos_y), 
										.position_x(position_x_2), 
										.position_y(position_y_2), 
										.position_valid(position_valid_2)); 
										 
									  
enemy_AI_ripple enemy_3(		.clk(clk), 
										.rand(rand), 
										.new_enemy(new_enemy_3), 
										.position_x(position_x_3), 
										.position_y(position_y_3), 
										.position_valid(position_valid_4));  
	  
enemy_AI_circle enemy_4(		.clk(clk), 
										.rand(rand), 
										.new_enemy(new_enemy_4), 
										.position_x(position_x_4), 
										.position_y(position_y_4), 
										.position_valid(position_valid_5));										 
 
enemy_AI_line enemy_5(		   .clk(clk), 
										.rand(rand), 
										.new_enemy(new_enemy_5), 
										.position_x(position_x_5), 
										.position_y(position_y_5), 
										.position_valid(position_valid_6));  
										  
enemy_AI_stationary enemy_6(		.clk(clk), 
                                    .rand(rand), 
                                    .new_enemy(new_enemy_6), 
                                    .position_x(position_x_6), 
                                    .position_y(position_y_6), 
                                    .position_valid(position_valid_7));  
												
/*enemy_AI_BOSS boss( 					.clk(clk),
											.rand(rand),
											.new_enemy(new_enemy_boss),
											.position_x(position_x_boss),
											.position_y(position_y_boss),
											.position_valid(position_valid_boss)); 

bullet_basic bullet_boss (   .clk(clk),
                                    .rand(rand),
                                    .new_bullet(new_bullet_enemy_boss),
                                    .enemy_pos_x(position_x_boss), 
                                    .enemy_pos_y(position_y_boss),
                                    .position_x(position_bullet_boss_x), 
                                    .position_y(position_bullet_boss_y), 
                                    .position_valid(position_valid_boss_bullet));  */ 

 
bullet_basic bullet_1		(       .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_1), 
                                    .position_x(position_bullet_x),  
                                    .position_y(position_bullet_y), 
                                    .position_valid(position_valid_3),  
                                    .enemy_pos_x(position_x_5),  
                                    .enemy_pos_y(position_y_5)); //line
												
bullet_basic bullet_enemy_1		(   .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_enemy_1), 
                                    .enemy_pos_x(position_x_2),  
                                    .enemy_pos_y(position_y_2), 
                                    .position_x(position_bullet_enemy_1_x),  
                                    .position_y(position_bullet_enemy_1_y),  
                                    .position_valid(position_valid_enemy_1));   
 
bullet_cha_1 bullet_cha_horizontal_1(  
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_cha_horizontal), 
                                    .cha_pos_x(cha_pos_x), 
                                    .cha_pos_y(cha_pos_y), 
                                    .position_x(position_bullet_cha_horizontal_x), 
                                    .position_y(position_bullet_cha_horizontal_y), 
                                    .position_valid(position_valid_cha_horizontal)); 
 
 
/*bullet_cha_1 bullet_cha_horizontal_2(  
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_cha_horizontal_1), 
                                    .cha_pos_x(cha_pos_x), 
                                    .cha_pos_y(cha_pos_y), 
                                    .position_x(position_bullet_cha_horizontal_x_1), 
                                    .position_y(position_bullet_cha_horizontal_y_1), 
                                    .position_valid(position_valid_cha_horizontal_1)); 
 
  
bullet_cha_1 bullet_cha_horizontal_3(  
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_cha_horizontal_2), 
                                    .cha_pos_x(cha_pos_x), 
                                    .cha_pos_y(cha_pos_y), 
                                    .position_x(position_bullet_cha_horizontal_x_2), 
                                    .position_y(position_bullet_cha_horizontal_y_2), 
                                    .position_valid(position_valid_cha_horizontal_2)); */
 
bullet_cha_2 bullet_cha_vertical(  
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_cha_vertical), 
                                    .cha_pos_x(cha_pos_x), 
                                    .cha_pos_y(cha_pos_y), 
                                    .position_x(position_bullet_cha_vertical_x), 
                                    .position_y(position_bullet_cha_vertical_y), 
                                    .position_valid(position_valid_cha_vertical)); 
 
/*bullet_line_1 bullet_enemy_upright( 
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_enemy_upright), 
                                    .enemy_pos_x(position_x_6),//stationary 
                                    .enemy_pos_y(position_y_6),//stationary 
                                    .position_x(position_bullet_enemy_stationary_upright_x), 
                                    .position_y(position_bullet_enemy_stationary_upright_y), 
                                    .position_valid(position_valid_bullet_enemy_stationary_upright)); 
 
bullet_line_2 bullet_enemy_upleft( 
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_enemy_upleft), 
                                    .enemy_pos_x(position_x_6),//stationary 
                                    .enemy_pos_y(position_y_6),//stationary 
                                    .position_x(position_bullet_enemy_stationary_upleft_x), 
                                    .position_y(position_bullet_enemy_stationary_upleft_y), 
                                    .position_valid(position_valid_bullet_enemy_stationary_upleft)); */
 
bullet_vertical bullet_enemy_vertical( 
                                    .clk(clk), 
                                    .rand(rand), 
                                    .new_bullet(new_bullet_enemy_vertical), 
                                    .enemy_pos_x(position_x_6),//stationary 
                                    .enemy_pos_y(position_y_6),//stationary 
                                    .position_x(position_bullet_enemy_stationary_vertical_x), 
                                    .position_y(position_bullet_enemy_stationary_vertical_y), 
                                    .position_valid(position_valid_bullet_enemy_stationary_vertical)); 
 
endmodule 
